約 2,211,024 件
https://w.atwiki.jp/yahirohumpty/pages/7.html
プログラミング C# MSDNのリファレンス重過ぎない? 覚書程度に. TIPS 手動で描画イベントハンドラの設定 IDEを使わないケース. private void test_paint(Object sender, PaintEventArgs e){ Graphics g=e.Graphics; g.DrawHogeHoge(); //なんか描画する } あとはコンストラクタで this.Paint+=new PaintEventHandler(test_paint); クライアントサイズの設定とリサイズ禁止 Javaと違ってクライアントサイズが使えるのがうれしい. リサイズ禁止属性はぱっとみ見当たらないが, FormBorderStyleを指定するとリサイズできなくなる. 最大最小サイズを設定するだけだとリサイズは結果的にできないがドラッグできてしまう. たぶん下のコードが正解. this.ClientSize=new Size(200,200); this.MaximumSize=this.Size; this.MinimumSize=this.Size; this.FormBorderStyle=FormBorderStyle.FixedSingle; MIDI制御 MidiControl.csを書いた. 基本的にはwinmm.dllをDLLImportして, Cの関数定義をトランスレートして呼び出すだけ. ただし構造体とかめんどくさすぎてやっていない. ポインタを使う場合はIntPtrを使う. 厄介なのはnew IntPtr(i)とかしてCの関数でポインタの中身をいじっても C#側のiが変更されない点. using System; using System.Runtime.InteropServices; namespace test{ public class MidiControl{ /* winmm midi interface */ [DllImport("winmm.dll")] private static extern uint midiOutOpen( ref IntPtr lphmo, uint uDeviceID, uint dwCallback, uint dwCallbackInstance, uint dwFlags); [DllImport("winmm.dll")] private static extern uint midiOutClose(int hmo); [DllImport("winmm.dll")] private static extern uint midiOutGetNumDevs(); [DllImport("winmm.dll")] private static extern uint midiOutShortMsg(int hmo, uint dwMsg); /* /winmm midi interface */ private int mdev; private uint res; private static MidiControl inst; public static MidiControl GetInstance(){ if(inst==null){ inst=new MidiControl(); } return inst; } private MidiControl(){} public uint Open(uint dev){ IntPtr mdevintptr=new IntPtr(); res=midiOutOpen(ref mdevintptr,dev,0,0,0); mdev=mdevintptr.ToInt32(); return res; } public uint Close(){ return midiOutClose(mdev); } public uint ShortMsg(uint ctrl){ return midiOutShortMsg(mdev,ctrl); } } } ジョイパッド(Win32API) DirectInputを使わないパターン. Cの場合次が参考になる. ジョイパッド http //f1.aaa.livedoor.jp/~zahyou/cgame/joypad.htm 問題なのはJoyInfoEx構造体を使う必要があること. 構造体の定義はmmsystem.hを直接コピー.DWORDはuintに. 構造体の扱いは次を参考に. @IT:.NET TIPS Win32 APIやDLL関数に構造体を渡すには? - C# http //www.atmarkit.co.jp/fdotnet/dotnettips/026w32struct/w32struct.html 一応次のコードで動くっぽい. using System; using System.Runtime.InteropServices; namespace test{ [StructLayout(LayoutKind.Sequential)] public struct JoyInfoEx{ public uint dwSize; /* size of structure */ public uint dwFlags; /* flags to indicate what to return */ public uint dwXpos; /* x position */ public uint dwYpos; /* y position */ public uint dwZpos; /* z position */ public uint dwRpos; /* rudder/4th axis position */ public uint dwUpos; /* 5th axis position */ public uint dwVpos; /* 6th axis position */ public uint dwButtons; /* button states */ public uint dwButtonNumber; /* current button number pressed */ public uint dwPOV; /* point of view state */ public uint dwReserved1; /* reserved for communication between winmm driver */ public uint dwReserved2; } public class JoyInfo{ /* winmm joyinfoex interface */ [DllImport("winmm.dll")] private static extern uint joyGetPosEx(uint uJoyID, IntPtr pji); /* /winmm joyinfoex interface */ private IntPtr pji; private JoyInfoEx ji; private uint res; private static JoyInfo inst; public static JoyInfo GetInstance(){ if(inst==null){ inst=new JoyInfo(); } return inst; } private JoyInfo(){ ji=new JoyInfoEx(); ji.dwSize=Marshal.SizeOf(ji); ji.dwFlags=0x00ff; // JOY_RETURNALL pji=Marshal.AllocHGlobal(Marshal.SizeOf(ji)); Marshal.StructureToPtr(ji,pji,false); } ~JoyInfo(){ Marshal.FreeHGlobal(pji); } public JoyInfoEx GetPosEx(uint jid){ res=joyGetPosEx(jid,pji); return (JoyInfoEx)Marshal.PtrToStructure(pji,typeof(JoyInfoEx)); } } } リンク集 MemoNyanDum C# GDI+ http //junki.lix.jp/csgdip.html コメントをどうぞ コメント欄設置しました. -- yahirohumpty (2009-02-07 20 29 46) 名前 コメント
https://w.atwiki.jp/ua-ks/pages/37.html
音まわり。 dsaudio.dll MCIAudioR [#gc98fe2c] 葉梨 [#a11af435] mml2midwrap.dll [#f6c618d9] dsaudio.dll 作者 みやま DirectShowで再生可能なフォーマット+OggVorbisを再生。 MCIAudioR 作者 umeici MIDI/WAV/MP3/WMA/AUを再生。 葉梨 作者 umeici 音声会話を合成する。 #ref error :ご指定のファイルが見つかりません。ファイル名を確認して、再度指定してください。 (hanasi_v02.lzh) mml2midwrap.dll 作者 さとー MML2MID (MML→MIDコンパイラ)を SAORI として使用するためのラッパ。 MML2MID.DLL 同梱 mml2midwrap100.zip
https://w.atwiki.jp/parepan/pages/87.html
PHPの設定/内部エンコードと出力エンコード設定一覧 ■内部:UTF-8 ■外部:UTF-8 default_charset="UTF-8" magic_quotes_gpc=off mbstring.input_encoding="pass" mbstring.internal_encoding="UTF-8" mbstring.output_encoding="pass" mbstring.language="japanese" mbstring.substitute_charactor="" ■内部:SJIS ■外部:EUC-JP 1、output_buffering output_buffering = On 2、output_handler output_handler = mb_output_handler 3、default_charset default_charset = EUC-JP 4、extensionにphp_mbstring.dllを指定(コメントを外す) extension=php_mbstring.dll 5、mbstring mbstring.language = Japanese mbstring.internal_encoding = SJIS mbstring.http_input = auto mbstring.http_output = EUC-JP mbstring.encoding_translation = On mbstring.detect_order = auto mbstring.substitute_character = none ■内部:EUC-JP ■外部:SJIS 1、output_buffering output_buffering = On 2、output_handler output_handler = mb_output_handler 3、default_charset default_charset = Shift_JIS 4、extensionにphp_mbstring.dllを指定(コメントを外す) extension=php_mbstring.dll 5、mbstring mbstring.language = Japanese mbstring.internal_encoding = EUC-JP mbstring.http_input = auto mbstring.http_output = SJIS mbstring.encoding_translation = On mbstring.detect_order = auto mbstring.substitute_character = none ■内部:EUC-JP ■外部:EUC-JP 1、output_buffering output_buffering = Off 2、default_charset default_charset = EUC-JP 3、extensionにphp_mbstring.dllを指定(コメントを外す) extension=php_mbstring.dll 4、mbstring mbstring.language = Japanese mbstring.internal_encoding = EUC-JP mbstring.http_input = auto mbstring.http_output = EUC-JP mbstring.encoding_translation = On mbstring.detect_order = auto mbstring.substitute_character = none
https://w.atwiki.jp/abwiki/pages/183.html
http //www.a-quest.com/products/からAquesTalk2 Winをダウソ。ついでにマヌアルと音声記号列仕様を落としおくといいかも。 いつものようにDeclareで関数宣言したらABがクソ過ぎてまともにインポートしない。 (起動したらAquesTalk2Da.dllImm32.dllがないっていうエラーを出す) 今回はLoadLibraryで対処した。もしDLLがcdeclっだったらと思うとぞっとするわね。 #N88BASICDim AquesTalk2Da_PlaySync As *Function(koe As *Byte, iSpeed As Long, phontDat As VoidPtr) As LongDim hDll As HANDLEDim koe[666] As BytehDll = LoadLibrary("AquesTalk2Da.dll")AquesTalk2Da_PlaySync = GetProcAddress(hDll, "AquesTalk2Da_PlaySync")wsprintf(koe,"わたしは/ひらいきみひこ。/か'こにあったことを/そして/みら'いにまた/おなじことがないよ'う、/か'んきを/うなが'しているだけだ。")AquesTalk2Da_PlaySync (koe,70,0)FreeLibrary(hDll)
https://w.atwiki.jp/mieki256/pages/35.html
#!/usr/bin/env python # -*- coding utf-8 -*- from distutils.core import setup import py2exe import os import glob script_file = fullscrpyglet.py icon_file = res/app.ico # add res/*.* res_files = [] for fn in os.listdir( res ) fn = os.path.join( res , fn) if os.path.isfile(fn) res_files.append(fn) py2exe_options = {"compressed" 1, "optimize" 2, "bundle_files" 2, # "includes" ["ctypes", "logging"], # "packages" [ pyglet ], # "excludes" ["pyglet"], } dll_files = [ # "avbin.pyo", ] setup( console=[{"script" script_file , "icon_resources" [(1, icon_file)]}], options={"py2exe" py2exe_options}, # zipfile=None, data_files=[( res , res_files), ( . , glob.glob( *.dll )), ( . , glob.glob( *.pyd )), ( . , dll_files)], )
https://w.atwiki.jp/isoroku_be/pages/73.html
情報 作者名:まっこう 引用元:なでしこプログラム掲示板「タブ型なでしこエディタ(印刷機能付き)」 概要 ウィンドウの×ボタンの有効/無効を切り替えます。 解説 引数 HANDLE:対象ウィンドウのハンドル サンプルプログラム 1の間 母艦のタイトル=「有効」。 (母艦ハンドル)を窓ハンドル終了ボタン有効。 1秒待つ。 母艦のタイトル=「無効」。 (母艦ハンドル)を窓ハンドル終了ボタン無効。 1秒待つ。 //本体 ●窓ハンドル終了ボタン有効(HANDLEの|HANDLEを) EnableMenuItem((HANDLE)のシステムメニューハンドル取得,$F060,0)。 ●窓ハンドル終了ボタン無効(HANDLEの|HANDLEを) EnableMenuItem((HANDLE)のシステムメニューハンドル取得,$F060,1)。 ●システムメニューハンドル取得(HANDLEの) GetSystemMenu(HANDLE,0)。それで戻る。 ●GetSystemMenu(hWnd,bRevert)=DLL("user32.dll","DWORD GetSystemMenu(HWND,BOOL)") ●EnableMenuItem(hMenu,uItemID,uEnable)=DLL("user32.dll","BOOL EnableMenuItem(DWORD,int,int)") 名前 コメント
https://w.atwiki.jp/fieds_labo2/pages/126.html
Wlanapi.dllが見つからなかったため、このアプリケーションを開始できませんでした。 アプリケーションをインストールし直すと治るかも? そのまま再インストールしても治りませんw 同じソフトをインストールした後に、PC起動時にエラーが表示されるPCと表示されないPCがあるとのこと。 エラーが表示されるPCはXPSP2でした。 DLL名が変わったそうです。 SP2:wlanapi.dll SP3:Wlanapi.dll Windows XP Service Pack 3 のインストール後、コンピュータを再起動するたびにエラー メッセージが表示される WindowsXP SP3 導入の余波。 - WLANmon.exe と WZCSLDR2.exe のエントリポイントが見つかりません 「Wlanapi.dllが見つからなかったため、このアプリケーションを開始できませんでした。」? wlanapi.dll から見つかりませんでした par3 ちなみにエラーを吐いたのは、TMDC.exe です。 動いていないということですよね、困りました@@;
https://w.atwiki.jp/ooooasys/pages/2.html
トップページ 文書フォーマット マニュアル入手方法 OASYS区点コード ファイルのプロパティ情報 .oasファイル .fmtファイル .oa2ファイル .oa3ファイル 内部情報 fmlbalc1.dll fmlbini1.dll fmlbini9.dll OpenOffice.org フィルタ関係文書 そのほか 適当なメモ コメントがあればお願いします コメントページ ログイン ここを編集 total - today - yesterday - 更新履歴 取得中です。
https://w.atwiki.jp/dellkeitai/pages/35.html
参考URL http //kyle-in-jp.blogspot.com/2011/07/jmagick.html 実行構成の設定 JREを32bitを指定する 64bitだとdllが32bitのためエラーになる 環境でPATHを設定する ./lib/;C \Program Files (x86)\ImageMagick-6.3.9-Q16 libにはjmagic.dllを入れておく
https://w.atwiki.jp/abwiki/pages/58.html
UTF82SJIS http //blog.goo.ne.jp/xmldtp/e/7eaeeb3dabfe975dbc57f73aefb1c059からコピペ #N88BASIC Function utf8ToSjis(utf8 As *Byte) As *Byte Dim utf16 As *Word Dim wlen As Long Dim sjis As *Byte utf8ToSjis = NULL If utf8 = NULL Then Exit Function End If ============================== UTF8=>UTF16変換 ============================== まずは、wlenの長さをとる wlen = MultiByteToWideChar(CP_UTF8, 0, utf8, -1, NULL, 0) If wlen = 0 Then Exit Function End If utf16の領域確保 utf16 = calloc(wlen + 1) If utf16 = NULL Then Exit Function End If utf16変換 If MultiByteToWideChar(CP_UTF8, 0, utf8, -1, utf16, wlen) = 0 Then free(utf16) Exit Function End If ============================== UTF16=>ShiftJIS変換 ============================== まずは、長さを取得 Dim mlen As Long mlen = WideCharToMultiByte(CP_ACP,0,utf16,-1,NULL,0," ",NULL) If mlen = 0 Then free(utf16) Exit Function End If 領域確保 sjis = calloc(mlen + 1) If sjis = NULL Then free(utf16) Exit Function End If utf16変換 If WideCharToMultiByte(CP_ACP,0,utf16,-1,sjis,mlen," ",NULL) = 0 Then free(utf16) free(sjis) Exit Function End If free(utf16) utf8ToSjis = sjis End Function Dim utf8[1000] As Byte Dim sjis As *Byte Dim hF As HANDLE Dim r As DWord hF = CreateFile("utf8.txt", GENERIC_READ,0,ByVal 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,0) ReadFile(hF, utf8,1000, Varptr(r),ByVal 0) sjis = utf8ToSjis(utf8) Print MakeStr(sjis) CloseHandle(hF) free(sjis) Input sjis WinAPIを使うべき処理 ShiftJIS→Unicode(UCS-2)変換 MultiByteToWideChar関数を使う。 MultiByteToWideChar(外部ページ) に詳しい。誰かコピーして。 Unicode(UCS-2)→ShiftJIS変換 WideCharToMultiByte関数を使う。 WideCharToMultiByte(外部ページ) に詳しい。誰かコピーして。 WinAPIを使わなくてもプログラム側で簡単に変換できるもの ShiftJIS→EUC-JP変換 ShiftJISとEUC-JPはエンコードが違うだけで同じ符号体系を用いている。その為、この変換は比較的容易い。 Sub SJIS2EUCJP(src As *Byte,dst As *Byte) Dim is=0 As Long,id=0 As Long Do If src[is]=0 then dst[id]=0 Exit Do Else If src[is] H80 then dst[id]=src[is] is++ id++ Else If ( HA1 =src[is]) And (src[is] = HDF) then dst[id]= H8E dst[id+1]=src[is] is++ id+=2 Else Dim a As Long,b As Long b=src[is+1]- H3F If b=0 then dst[id]=0 Exit Do End If If b 63 then b-- a=src[is]*2- H101 If a 62 then a-=128 If b 94 then b-=94 a++ End If If (a 1) Or (94 a) Or (b 1) Or (94 b) then dst[id]=0 Exit Do End If dst[id]=a+ HA0 dst[id+1]=b+ HA0 is+=2 id+=2 End If Loop End Sub EUC-JP→ShiftJIS変換 Sub EUCJP2SJIS(src As *Byte,dst As *Byte) Dim is=0 As Long,id=0 As Long Do If src[is]=0 then dst[id]=0 Exit Do Else If src[is] H80 then dst[id]=src[is] is++ id++ Else If src[is]= H8E then dst[id]=src[is+1] is+=2 id++ Else If src[is]= H8F then JIS X 0212-1990文字集合だが、Shift-JISには無いため?で代用する。 dst[id]=Asc("?") is+=3 id++ Else Dim a As Long,b As Long a=src[is]- HA0 b=src[is+1]- HA0 If (a 1) Or (94 a) Or (b 1) Or (94 b) then dst[id]=0 Exit Do End If a-- If a and 1 then a-- b+=94 End If a=(a 1)+ H81 If b 63 then b++ If a H9F then a+=64 dst[id]=a dst[id+1]=b+ H3F is+=2 id+=2 End If Loop End Sub Unicode(UCS-2)→Unicode(UTF-8)変換 UCS-2とUTF-8はエンコードが違うだけで同じ符号体系を用いている。その為、この変換は比較的容易い。 Sub UCS22UTF8(src As *Byte,dst As *Byte) Dim is=2 As Long,id=0 As Long Dim fBE As Long If (src[0]= HFF) and (src[1]= HFE) then BOM fBE=0 Else If (src[0]= HFE) and (src[1]= HFF) then fBE=1 Else default=Big Endian(RFC 2781) fBE=1 is-=2 End If Do If src[is]=0 And src[is+1]=0 then dst[id]=0 Exit Do Else Dim c As Long c=src[is+(1-fBE)] As Long*256+src[is+fBE] If c H80 then dst[id]=c id++ Else If c H800 then dst[id]= HC0 Or (c 6) dst[id+1]= H80 Or (c and H3F) id+=2 Else If c H10000 then dst[id]= HE0 Or (c 12) dst[id+1]= H80 Or ((c 6) and H3F) dst[id+2]= H80 Or (c and H3F) id+=3 Else dst[id]=0 Exit Do End If is+=2 End If Loop End Sub Unicode(UTF-8)→Unicode(UCS-2) Sub UTF82UCS2(src As *Byte,dst As *Byte) Dim is=0 As Long,id=2 As Long If (src[0]= HEF) And (src[1]= HBB) And (src[2]= HBF) then is+=3 dst[0]= HFE dst[1]= HFF Do If src[is]=0 then dst[id]=0 Exit Do Else Dim c As Long If src[is] H80 then c=src[is] is++ Else If src[is] HE0 then If src[is+1]=0 then dst[id]=0 Exit Do Else c=((src[is] And H1F) 6) Or (src[is+1] And H3F) is+=2 End If Else If src[is] HF0 then If src[is+1]=0 then dst[id]=0 Exit Do Else If src[is+2]=0 then dst[id]=0 Exit Do Else c=((src[is] And H0F) 12) Or ((src[is+1] And H3F) 6) Or (src[is+2] And H3F) is+=3 End If Else If src[is] HF8 then If src[is+1]=0 then dst[id]=0 Exit Do Else If src[is+2]=0 then dst[id]=0 Exit Do Else If src[is+3]=0 then dst[id]=0 Exit Do Else c=((src[is] And H03) 18) Or ((src[is+1] And H3F) 12) Or ((src[is+2] And H3F) 6) Or (src[is+3] And H3F) is+=4 End If Else dst[id]=0 Exit Do End If If c H10000 then UCS2には拡張領域が無いため表現できない。 dst[id]=0 dst[id+1]=Asc("?") id+=2 Else dst[id]=c 8 dst[id+1]=c And HFF id+=2 End If End If Loop End Sub nkf32を使って nkf32は文字コードの各種変換を行う便利ライブラリ。 DLLとして提供されていて、使い易くなってる。 ABも実はこれを使っている。SubOperationフォルダーを参照。 使い方は結構簡単で、例えば次のようにするだけで、何らかの文字コードのファイルをEUCに変換してくれる。 #N88BASIC'宣言Declare Sub GetNkfVersion Lib "Nkf32.dll" (verStr As *Byte)Declare Function SetNkfOption Lib "Nkf32.dll" (optStr As *Byte) As LongDeclare Sub NkfConvert Lib "Nkf32.dll" (outStr As *Byte, inStr As *Byte)Declare Sub ToHankaku Lib "Nkf32.dll" (inStr As *Byte)Declare Sub ToZenkakuKana Lib "Nkf32.dll" (outStr As *Byte, inStr As *Byte)Declare Sub ToMime Lib "Nkf32.dll" Alias "EncodeSubject" (outStr As *Byte, inStr As *Byte)Declare Sub EncodeSubject Lib "Nkf32.dll" (outStr As *Byte, inStr As *Byte)Dim vstr[478] As ByteDim in As *ByteDim out As *ByteDim size As DWordGetNkfVersion(vstr)Print "nkf32のバージョン→" MakeStr(vstr)in = LoadFile(VarPtr(size))If in And size Then Print "読み取りOK" Else EndIf SetNkfOption("-e") = 0 Then Print "EUCに変換します"out = calloc(size+1)NkfConvert(out, in)SaveFile(out, lstrlen(out))Print "おわり"End'ファイルを開いて中身を返すFunction LoadFile(sss As *Long) As *ByteDim ofn As OPENFILENAMEDim buffer[333] As Byteofn.lStructSize=SizeOf(OPENFILENAME)ofn.hwndOwner=GetActiveWindow()ofn.lpstrFilter=Ex"テキスト ファイル(*.txt)\0*.txt\0すべてのファイル(*.*)\0*\0"ofn.nFilterIndex=1ofn.lpstrFile=bufferofn.nMaxFile=333ofn.lpstrTitle="ファイルを開く"ofn.Flags=OFN_FILEMUSTEXIST or OFN_PATHMUSTEXISTIf GetOpenFileName(ofn)=0 Then Exit Function'OpenDim hF As HANDLEDim r As DwordDim x As *BytehF = CreateFile( buffer, GENERIC_READ, 0, ByVal 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)SetDWord(sss, GetFileSize(hF, 0))x = calloc(GetDword(sss)+1)ReadFile(hF, x, GetDword(sss), sss, ByVal 0)CloseHandle(hF)LoadFile = xEnd Function'oooの内容を保存Function SaveFile(ooo As *Byte, sss As Long) As LongDim ofn As OPENFILENAMEDim buffer[333] As Byteofn.lStructSize=SizeOf(OPENFILENAME)ofn.hwndOwner=GetActiveWindow()ofn.lpstrFilter=Ex"テキスト ファイル(*.txt)\0*.txt\0すべてのファイル(*.*)\0*\0"ofn.nFilterIndex=1ofn.lpstrFile=bufferofn.nMaxFile=333ofn.lpstrTitle="ファイルを保存"ofn.Flags=OFN_FILEMUSTEXIST or OFN_PATHMUSTEXISTIf GetSaveFileName(ofn)=0 Then Exit Function'OpenDim hF As HANDLEDim w As DwordhF = CreateFile(buffer, GENERIC_WRITE, 0, ByVal 0, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, 0)WriteFile(hF, ooo, sss, VarPtr(w), ByVal 0)CloseHandle(hF)SaveFile = 44End Function